package com.sky.mapper;


import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface FlavorMapper {

    /**
     * 批量添加菜品口味
     * @param flavorList
     */
    void insertBatch(List<DishFlavor> flavorList);


    /**
     * 批量删除菜品口味
     * @param ids
     */
    void delete(List<Long> ids);


    /**
     * 根据菜品id删除口味数据
     * @param id
     */
    @Delete("delete from sky_take_out.dish_flavor where dish_id = #{id}")
    void deleteById(Long id);


    /**
     * 通过菜品id获取口味
     * @param id
     * @return
     */
    @Select("select * from sky_take_out.dish_flavor where dish_id = #{id}")
    List<DishFlavor> getByDishId(Long id);
}
